<%@ page language="java" import="java.io.*,java.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Request and Form Example</title>
</head>
<body>
<%
   Enumeration<String> paramNames = request.getParameterNames();
   if(paramNames.hasMoreElements()){
%>
<ul>
<li><p><b>Name:</b>
   <%= request.getParameter("name")%>
</p></li>
<li><p><b>Sex:</b>
   <%= request.getParameter("sex")%>
</p></li>
<li><p><b>Like Burger:</b>
   <%= request.getParameter("burger")%>
</p></li>
<li><p><b>Like Coffee:</b>
   <%= request.getParameter("coffee")%>
</p></li>
<%
   } else {
%>
<form action="formrequest.jsp" method="POST">
Name: <input type="text" name="name"><br />
SITI: <input type="text" name="sex" /><br/>
Like Burger:<input type="checkbox" name="burger" checked="checked" /><br/> 
Like Coffee: <input type="checkbox" name="coffee"  /><br/> 
<input type="submit" value="Submit" />
</form>
<% } %>
</body>
</html>